package com.telecom.mapper;

import com.telecom.entity.Staff;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StaffMapper {
    @Select("select * from staff")
    List<Staff> selectAll();
    List<Staff> selectByCity(String city);

    Double selectAvgSalByAddr(String addr);

    void updateByAddr(Staff staff);
    //所有的参数，都封装到一个对象中，将对象做为参数传递
    //参数是没有封装到对象中，参数是多个传递的

    void updateByAddr2(@Param("sal") Integer sal,
                       @Param("job") String job,
                       @Param("addr") String addr);

    void deleteByIds(Integer[] ids);
    void deleteByIdList(List<Integer> ids);
    void deleteByObj(Staff staff);
    void insertBatch(List<Staff> staffs);
    //delete  form staff where id in (1,2,3)
    //delete from staff where id=1 or id=2 or id=3
}
